Product Code Database
Example Keywords: wi-fi -world $87
   » » Wiki: Conjugate Prior
Tag Wiki 'Conjugate Prior'.
Tag

In Bayesian probability theory, if, given a likelihood function p(x \mid \theta), the posterior distribution p(\theta \mid x) is in the same probability distribution family as the prior probability distribution p(\theta), the prior and posterior are then called conjugate distributions with respect to that likelihood function and the prior is called a conjugate prior for the likelihood function p(x \mid \theta).

A conjugate prior is an algebraic convenience, giving a closed-form expression for the posterior; otherwise, numerical integration may be necessary. Further, conjugate priors may clarify how a likelihood function updates a prior distribution.

The concept, as well as the term "conjugate prior", were introduced by and in their work on Bayesian decision theory. and . Applied Statistical Decision Theory. Division of Research, Graduate School of Business Administration, Harvard University, 1961. A similar concept had been discovered independently by George Alfred Barnard.Jeff Miller et al. Earliest Known Uses of Some of the Words of Mathematics, "conjugate prior distributions". Electronic document, revision of November 13, 2005, retrieved December 2, 2005.


Example
The form of the conjugate prior can generally be determined by inspection of the probability density or probability mass function of a distribution. For example, consider a which consists of the number of successes s in n with unknown probability of success q in 0,1. This random variable will follow the binomial distribution, with a probability mass function of the form
p(s) = {n \choose s}q^s (1-q)^{n-s}

The usual conjugate prior is the beta distribution with parameters (\alpha, \beta):

p(q) = {q^{\alpha-1}(1-q)^{\beta-1} \over \Beta(\alpha,\beta)}
where \alpha and \beta are chosen to reflect any existing belief or information (\alpha=1 and \beta=1 would give a uniform distribution) and \Beta(\alpha,\beta) is the acting as a normalising constant.

In this context, \alpha and \beta are called hyperparameters (parameters of the prior), to distinguish them from parameters of the underlying model (here q). A typical characteristic of conjugate priors is that the dimensionality of the hyperparameters is one greater than that of the parameters of the original distribution. If all parameters are scalar values, then there will be one more hyperparameter than parameter; but this also applies to vector-valued and matrix-valued parameters. (See the general article on the exponential family, and also consider the Wishart distribution, conjugate prior of the covariance matrix of a multivariate normal distribution, for an example where a large dimensionality is involved.)

If we sample this random variable and get s successes and f = n - s failures, then we have

\begin{align}
 P(s, f \mid q=x) &= {s+f \choose s} x^s(1-x)^f,\\
             P(q=x) &= {x^{\alpha-1}(1-x)^{\beta-1} \over \Beta(\alpha,\beta)},\\
  P(q=x \mid s,f) &= \frac{P(s, f \mid x)P(x)}{\int P(s, f \mid y)P(y)dy}\\
                  & = {0!} \approx 0.93
     

This is the Poisson distribution that is the most likely to have generated the observed data \mathbf{x}. But the data could also have come from another Poisson distribution, e.g., one with \lambda = 3, or \lambda = 2, etc. In fact, there is an infinite number of Poisson distributions that could have generated the observed data. With relatively few data points, we should be quite uncertain about which exact Poisson distribution generated this data. Intuitively we should instead take a weighted average of the probability of p(x>0| \lambda) for each of those Poisson distributions, weighted by how likely they each are, given the data we've observed \mathbf{x}.

Generally, this quantity is known as the posterior predictive distribution p(x|\mathbf{x}) = \int_\theta p(x|\theta)p(\theta|\mathbf{x})d\theta\,, where x is a new data point, \mathbf{x} is the observed data and \theta are the parameters of the model. Using Bayes' theorem we can expand p(\theta|\mathbf{x}) = \frac{p(\mathbf{x}|\theta)p(\theta)}{p(\mathbf{x})}\,, therefore p(x|\mathbf{x}) = \int_\theta p(x|\theta)\frac{p(\mathbf{x}|\theta)p(\theta)}{p(\mathbf{x})}d\theta\,. Generally, this integral is hard to compute. However, if you choose a conjugate prior distribution p(\theta), a closed-form expression can be derived. This is the posterior predictive column in the tables below.

Returning to our example, if we pick the Gamma distribution as our prior distribution over the rate of the Poisson distributions, then the posterior predictive is the negative binomial distribution, as can be seen from the table below. The Gamma distribution is parameterized by two hyperparameters \alpha, \beta, which we have to choose. By looking at plots of the gamma distribution, we pick \alpha = \beta = 2, which seems to be a reasonable prior for the average number of cars. The choice of prior hyperparameters is inherently subjective and based on prior knowledge.

Given the prior hyperparameters \alpha and \beta we can compute the posterior hyperparameters \alpha' = \alpha + \sum_i x_i = 2 + 3+4+1 = 10 and \beta' = \beta + n = 2+3 = 5

Given the posterior hyperparameters, we can finally compute the posterior predictive of p(x>0|\mathbf{x}) = 1-p(x=0|\mathbf{x}) = 1 - NB\left(0\, |\, 10, \frac{5}{1+5}\right) \approx 0.84

This much more conservative estimate reflects the uncertainty in the model parameters, which the posterior predictive takes into account.


Table of conjugate distributions
Let n denote the number of observations. In all cases below, the data is assumed to consist of n points x_1,\ldots,x_n (which will be in the multivariate cases).

If the likelihood function belongs to the exponential family, then a conjugate prior exists, often also in the exponential family; see .


When the likelihood function is a discrete distribution
\alpha + \sum_{i=1}^n x_i,\, \beta + n - \sum_{i=1}^n x_i\!\alpha successes, \beta failuresp(\tilde{x}=1) = \frac{\alpha'}{\alpha'+\beta'}
(Bernoulli)
\alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\!\alpha successes, \beta failures\operatorname{BetaBin}(\tilde{x}>\alpha',\beta')
(beta-binomial)
\alpha + rn ,\, \beta + \sum_{i=1}^n x_i\!\alpha total successes, \beta failures (i.e., \frac{\beta}{r} experiments, assuming r stays fixed)\operatorname{BetaNegBin}(\tilde{x}>\alpha',\beta') (beta-negative binomial)
Poissonλ (rate)Gammak + \sum_{i=1}^n x_i,\ \frac {\theta} {n \theta + 1}\!k total occurrences in \frac{1}{\theta} intervals\operatorname{NB}\left(\tilde{x}\mid k', \frac{1}{\theta'+1}\right)
(negative binomial)
\alpha + \sum_{i=1}^n x_i ,\ \beta + n\!\alpha total occurrences in \beta intervals\operatorname{NB}\left(\tilde{x}\mid\alpha', \frac{\beta'}{1 + \beta'}\right)
(negative binomial)
\boldsymbol\alpha + (c_1, \ldots, c_k), where c_i is the number of observations in category i\alpha_i occurrences of category i\begin{align}
   p(\tilde{x}=i) &= \frac\mid\boldsymbol\alpha')
(Dirichlet-multinomial)
\alpha + \sum_{i=1}^n x_i,\, \beta + \sum_{i=1}^nN_i - \sum_{i=1}^n x_i\!\alpha successes, \beta failures
\alpha + n,\, \beta + \sum_{i=1}^n x_i\!\alpha experiments, \beta total failures


When likelihood function is a continuous distribution
\frac{1}{\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}}\left(\frac{\mu_0}{\sigma_0^2} + \frac{\sum_{i=1}^n x_i}{\sigma^2}\right), \left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right)^{-1}mean was estimated from observations with total precision (sum of all individual precisions) 1/\sigma_0^2 and with sample mean \mu_0\mathcal{N}(\tilde{x}>\mu_0', {\sigma_0^2}' +\sigma^2)
\frac{\tau_0 \mu_0 + \tau \sum_{i=1}^n x_i}{\tau_0 + n \tau},\, \left(\tau_0 + n \tau\right)^{-1}mean was estimated from observations with total precision (sum of all individual precisions)\tau_0 and with sample mean \mu_0\mathcal{N}\left(\tilde{x}\mid\mu_0', \frac{1}{\tau_0'} +\frac{1}{\tau}\right)
\mathbf{\alpha}+\frac{n}{2},\, \mathbf{\beta} + \frac{\sum_{i=1}^n{(x_i-\mu)^2}}{2} variance was estimated from 2\alpha observations with sample variance \beta/\alpha (i.e. with sum of squared deviations 2\beta, where deviations are from known mean \mu)t_{2\alpha'}(\tilde{x}>\mu,\sigma^2 = \beta'/\alpha')
\nu+n,\, \frac{\nu\sigma_0^2 + \sum_{i=1}^n (x_i-\mu)^2}{\nu+n}\!variance was estimated from \nu observations with sample variance \sigma_0^2t_{\nu'}(\tilde{x}>\mu,{\sigma_0^2}')
\alpha + \frac{n}{2},\, \beta + \frac{\sum_{i=1}^n (x_i-\mu)^2}{2}\!precision was estimated from 2\alpha observations with sample variance \beta/\alpha (i.e. with sum of squared deviations 2\beta, where deviations are from known mean \mu)t_{2\alpha'}(\tilde{x}\mid\mu,\sigma^2 = \beta'/\alpha')
Normal-inverse gamma\frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\,
\beta + \tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{n\nu}{\nu+n}\frac{(\bar{x}-\mu_0)^2}{2}
  • \bar{x} is the sample mean
mean was estimated from \nu observations with sample mean \mu_0; variance was estimated from 2\alpha observations with sample mean \mu_0 and sum of squared deviations 2\betat_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\nu' \alpha'}\right)
Normal-gamma\frac{\nu\mu_0+n\bar{x}}{\nu+n} ,\, \nu+n,\, \alpha+\frac{n}{2} ,\,
\beta + \tfrac{1}{2} \sum_{i=1}^n (x_i - \bar{x})^2 + \frac{n\nu}{\nu+n}\frac{(\bar{x}-\mu_0)^2}{2}
  • \bar{x} is the sample mean
mean was estimated from \nu observations with sample mean \mu_0, and precision was estimated from 2\alpha observations with sample mean \mu_0 and sum of squared deviations 2\betat_{2\alpha'}\left(\tilde{x}\mid\mu',\frac{\beta'(\nu'+1)}{\alpha'\nu'}\right)
\left(\boldsymbol\Sigma_0^{-1} + n\boldsymbol\Sigma^{-1}\right)^{-1}\left( \boldsymbol\Sigma_0^{-1}\boldsymbol\mu_0 + n \boldsymbol\Sigma^{-1} \mathbf{\bar{x}} \right),
\left(\boldsymbol\Sigma_0^{-1} + n\boldsymbol\Sigma^{-1}\right)^{-1}
  • \mathbf{\bar{x}} is the sample mean
mean was estimated from observations with total precision (sum of all individual precisions)\boldsymbol\Sigma_0^{-1} and with sample mean \boldsymbol\mu_0\mathcal{N}(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', {\boldsymbol\Sigma_0}' +\boldsymbol\Sigma)
\left(\boldsymbol\Lambda_0 + n\boldsymbol\Lambda\right)^{-1}\left( \boldsymbol\Lambda_0\boldsymbol\mu_0 + n \boldsymbol\Lambda \mathbf{\bar{x}} \right),\, \left(\boldsymbol\Lambda_0 + n\boldsymbol\Lambda\right)
  • \mathbf{\bar{x}} is the sample mean
mean was estimated from observations with total precision (sum of all individual precisions)\boldsymbol\Lambda_0 and with sample mean \boldsymbol\mu_0\mathcal{N}\left(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', >\boldsymbol\mu,\frac{1}{\nu'-p+1}\boldsymbol\Psi'\right)
n+\nu ,\, \left(\mathbf{V}^{-1} + \sum_{i=1}^n (\mathbf{x_i} - \boldsymbol\mu) (\mathbf{x_i} - \boldsymbol\mu)^T\right)^{-1} covariance matrix was estimated from \nu observations with sum of pairwise deviation products \mathbf{V}^{-1}t_{\nu'-p+1}\left(\tilde{\mathbf{x}}\mid\boldsymbol\mu,\frac{1}{\nu'-p+1}{\mathbf{V}'}^{-1}\right)
\frac{\kappa_0\boldsymbol\mu_0+n\mathbf{\bar{x}}}{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\,
\boldsymbol\Psi + \mathbf{C} + \frac{\kappa_0 n}{\kappa_0+n}(\mathbf{\bar{x}}-\boldsymbol\mu_0)(\mathbf{\bar{x}}-\boldsymbol\mu_0)^T
  • \mathbf{\bar{x}} is the sample mean
  • \mathbf{C} = \sum_{i=1}^n (\mathbf{x_i} - \mathbf{\bar{x}}) (\mathbf{x_i} - \mathbf{\bar{x}})^T
mean was estimated from \kappa_0 observations with sample mean \boldsymbol\mu_0; covariance matrix was estimated from \nu_0 observations with sample mean \boldsymbol\mu_0 and with sum of pairwise deviation products \boldsymbol\Psi=\nu_0\boldsymbol\Sigma_0t_>{\boldsymbol\mu_0}',\frac{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\,
\left(\mathbf{V}^{-1} + \mathbf{C} + \frac{\kappa_0 n}{\kappa_0+n}(\mathbf{\bar{x}}-\boldsymbol\mu_0)(\mathbf{\bar{x}}-\boldsymbol\mu_0)^T\right)^{-1}
  • \mathbf{\bar{x}} is the sample mean
  • \mathbf{C} = \sum_{i=1}^n (\mathbf{x_i} - \mathbf{\bar{x}}) (\mathbf{x_i} - \mathbf{\bar{x}})^T
mean was estimated from \kappa_0 observations with sample mean \boldsymbol\mu_0; covariance matrix was estimated from \nu_0 observations with sample mean \boldsymbol\mu_0 and with sum of pairwise deviation products \mathbf{V}^{-1}t_\mid {\boldsymbol\mu_0}', \frac\!\alpha observations with sum \beta of the order of magnitude of each observation (i.e. the logarithm of the ratio of each observation to the minimum x_m)
a+n,\, b+\sum_{i=1}^n x_i^{\beta}\!a observations with sum b of the β'th power of each observation
Log-normalSame as for the normal distribution after applying the natural logarithm to the data for the posterior hyperparameters. Please refer to to see the details.
\alpha+n,\, \beta+\sum_{i=1}^n x_i\!\alpha observations that sum to \beta \operatorname{Lomax}(\tilde{x}\mid\beta',\alpha')
(Lomax distribution)
\alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n x_i\!\alpha_0/\alpha observations with sum \beta_0\operatorname{CG}(\tilde{\mathbf{x}}\mid\alpha,{\alpha_0}',{\beta_0}')=\operatorname{\beta'}(\tilde{\mathbf{x}}>\alpha,{\alpha_0}',1,{\beta_0}')
\alpha_0+n\alpha,\, \beta_0+\sum_{i=1}^n \frac{1}{x_i}\!\alpha_0/\alpha observations with sum \beta_0
α (shape)\propto \frac{a^{\alpha-1} \beta^{\alpha c}}{\Gamma(\alpha)^b}a \prod_{i=1}^n x_i,\, b + n,\, c + n\!b or c observations (b for estimating \alpha, c for estimating \beta) with product a
p \prod_{i=1}^n x_i,\, q + \sum_{i=1}^n x_i,\, r + n,\, s + n \!\alpha was estimated from r observations with product p; \beta was estimated from s observations with sum q
p \prod_{i=1}^n x_i,\, q \prod_{i=1}^n (1-x_i),\, k + n \!\alpha and \beta were estimated from k observations with product p and product of the complements q


See also
  • Beta-binomial distribution


Notes
Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs
1s Time